import { request } from '@/service/request';
import { SysOperateLog } from "@/views/system/log/operate-log/index";

export function fetchLog(id: Common.IdType) {
  return request({
    url: `/system/operateLog/${id}`,
    method: 'GET',
  });
}

export function fetchLogPage(page: Common.Page<SysOperateLog>, searchData: any) {
  return request({
    url: '/system/operateLog/listBySearchDto',
    data: { page, searchData },
    method: 'POST',
  });
}

export function fetchLogModule() {
  return request({
    url: '/system/operateLog/moduleList',
    method: 'GET',
  });
}

export function fetchAddLog(data: SysOperateLog) {
  return request({
    url: '/system/operateLog/',
    data: data,
    method: 'POST',
  });
}

export function fetchUpdateLog(data: SysOperateLog) {
  return request({
    url: '/system/operateLog/',
    data: data,
    method: 'PUT',
  });
}

export function fetchDelLog(ids: Common.IdType[]) {
  return request({
    url: `/system/operateLog/${ids}`,
    method: 'DELETE',
  });
}
